---
title: OidcProvider
editUrl: https://github.com/toolbeam/openauth/blob/master/packages/openauth/src/provider/oidc.ts
description: Reference doc for the `OidcProvider`.
---

import { Segment, Section, NestedTitle, InlineSection } from 'toolbeam-docs-theme/components'
import { Tabs, TabItem } from '@astrojs/starlight/components'

<div class="tsdoc">
<Section type="about">
Use this to connect authentication providers that support OIDC.

```ts {5-8}
import { OidcProvider } from "@openauthjs/openauth/provider/oidc"

export default issuer({
  providers: {
    oauth2: OidcProvider({
      clientId: "1234567890",
      issuer: "https://auth.myserver.com"
    })
  }
})
```
</Section>
---
## Methods
### OidcProvider
<Segment>
<Section type="signature">
```ts
OidcProvider(config)
```
</Section>
<Section type="parameters">
#### Parameters
- <p><code class="key">config</code> [<code class="type">OidcConfig</code>](/docs/provider/oidc#oidcconfig)</p>
</Section>
<InlineSection>
**Returns** <code class="type">Provider</code>
</InlineSection>
</Segment>
## OidcConfig
<Segment>
<Section type="parameters">
- <p>[<code class="key">clientID</code>](#oidcconfig.clientid) <code class="primitive">string</code></p>
- <p>[<code class="key">issuer</code>](#oidcconfig.issuer) <code class="primitive">string</code></p>
- <p>[<code class="key">query?</code>](#oidcconfig.query) <code class="primitive">Record</code><code class="symbol">&lt;</code><code class="primitive">string</code>, <code class="primitive">string</code><code class="symbol">&gt;</code></p>
- <p>[<code class="key">scopes?</code>](#oidcconfig.scopes) <code class="primitive">string</code><code class="symbol">[]</code></p>
</Section>
</Segment>
<NestedTitle id="oidcconfig.clientid" Tag="h4" parent="OidcConfig.">clientID</NestedTitle>
<Segment>
<Section type="parameters">
<InlineSection>
**Type** <code class="primitive">string</code>
</InlineSection>
</Section>
The client ID.

This is just a string to identify your app.
```ts
{
  clientID: "my-client"
}
```
</Segment>
<NestedTitle id="oidcconfig.issuer" Tag="h4" parent="OidcConfig.">issuer</NestedTitle>
<Segment>
<Section type="parameters">
<InlineSection>
**Type** <code class="primitive">string</code>
</InlineSection>
</Section>
The URL of your authorization server.
```ts
{
  issuer: "https://auth.myserver.com"
}
```
</Segment>
<NestedTitle id="oidcconfig.query" Tag="h4" parent="OidcConfig.">query?</NestedTitle>
<Segment>
<Section type="parameters">
<InlineSection>
**Type** <code class="primitive">Record</code><code class="symbol">&lt;</code><code class="primitive">string</code>, <code class="primitive">string</code><code class="symbol">&gt;</code>
</InlineSection>
</Section>
Any additional parameters that you want to pass to the authorization endpoint.
```ts
{
  query: {
    prompt: "consent"
  }
}
```
</Segment>
<NestedTitle id="oidcconfig.scopes" Tag="h4" parent="OidcConfig.">scopes?</NestedTitle>
<Segment>
<Section type="parameters">
<InlineSection>
**Type** <code class="primitive">string</code><code class="symbol">[]</code>
</InlineSection>
</Section>
A list of OIDC scopes that you want to request.
```ts
{
  scopes: ["openid", "profile", "email"]
}
```
</Segment>
</div>